package thread1;

import java.util.concurrent.*;

public class pool3 {
    public static final LinkedBlockingQueue<Integer> QUEUE = new LinkedBlockingQueue(10);

    public static void main(String[] args) throws ExecutionException, InterruptedException {
//        LinkedBlockingQueue<Integer> QUEUE = LinkedBlockingQueue;
        SynchronousQueue<Integer> syncQueue = new SynchronousQueue<>();

        Callable<Integer> c1 = new Callable(){

            @Override
            public Integer call() throws Exception {
                Thread.sleep(3000);
                return 1001;
            }
        };

        ScheduledExecutorService service = Executors.newScheduledThreadPool(10);
        Future<Integer> submit = service.submit(c1);
        Integer i = submit.get();
        System.out.println(i);
        service.shutdown();
    }
}
